/* GUI CONVERTED from eciq03.p (converter v1.76) Wed May 28 02:21:13 2003 */
/* eciq03.p - ECN PRODUCT STRUCTURE INQUIRY                             */
/* Copyright 1986-2003 QAD Inc., Carpinteria, CA, USA.                  */
/* All rights reserved worldwide.  This is an unpublished work.         */
/* $Revision: 1.8.1.5 $                                                     */
/*K0M5*/ /*                                                             */
/*V8:ConvertMode=Report                                        */
/* REVISION: 7.4      LAST MODIFIED: 10/11/93   BY: pma *H013*          */
/* REVISION: 7.4      LAST MODIFIED: 02/16/94   BY: qzl *H343*          */
/* REVISION: 7.4      LAST MODIFIED: 10/13/95   BY: ame *H0GF*          */
/* REVISION: 7.4      LAST MODIFIED: 12/30/95   BY: qzl *H0J1*          */
/* REVISION: 8.6      LAST MODIFIED: 06/18/97   BY: Joe Gawel    *K0F6* */
/* REVISION: 8.6      LAST MODIFIED: 08/13/97   BY: Joe Gawel    *K0H5* */
/* REVISION: 8.6      LAST MODIFIED: 10/07/97   BY: mzv *K0M5*          */

/* REVISION: 8.6E     LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane */
/* REVISION: 8.6E     LAST MODIFIED: 05/29/98   BY: *K1R7* A. Shobha */
/* REVISION: 8.6E     LAST MODIFIED: 10/04/98   BY: *J314* Alfred Tan   */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00 BY: *N08T* Annasaheb Rahane */
/* REVISION: 9.1      LAST MODIFIED: 08/14/00 BY: *N0KW* Jacolyn Neder    */
/* Old ECO marker removed, but no ECO header exists *F0PN*                    */
/* $Revision: 1.8.1.5 $    BY: K Paneesh             DATE: 05/27/03  ECO: *P0T5*  */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/

/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

{mfdeclre.i}
{pxmaint.i}

{pxphdef.i pspl}

{gplabel.i} /* EXTERNAL LABEL INCLUDE */

{ecmtparm.i}

define variable ecd1par    like ecd1_par no-undo.
define variable ecd1comp   like ecd1_comp no-undo.
define variable ecd1ref    like ecd1_ref no-undo.
define variable par_desc   like pt_desc1.
define variable comp_desc  like pt_desc1.
define variable l-um       like pt_um no-undo.
define variable psmand     like ps_mandatory.
define variable psdflt     like ps_default.
define variable ecdcmmts   like mfc_logical initial no label "Comments".
define variable true1      like mfc_logical initial yes.
define variable false1     like mfc_logical initial no.
define variable bombatch   like bom_batch.
define variable bombatchum like bom_batch_um.
define variable ecd1qad01  like ecd1__qad01.

/* DISPLAY SELECTION FORM */
FORM /*GUI*/ 
   {ecform06.i}
with STREAM-IO /*GUI*/  frame form06 width 80 side-labels.

/* SET EXTERNAL LABELS */
setFrameLabels(frame form06:handle).

find ecm_mstr
   where recid(ecm_mstr) = ecm_recid
no-lock no-error.

if not available (ecm_mstr)
then
   return.

if can-find (first ecd1_det
                where ecd1_nbr = ecm_nbr)
then
   page.

for each ecd1_det
   where ecd1_nbr = ecm_nbr
no-lock with frame form06:
   assign
      par_desc = ""
      comp_desc = "".

   find bom_mstr
      where bom_par = ecd1_par
   no-lock no-error.
   if available bom_mstr
      and bom_desc <> ""
   then
      par_desc = bom_desc.
   else do: /* IF AVAILABLE bom_mstr */
      find pt_mstr
         where pt_part = ecd1_par
   no-lock no-error.
      if available pt_mstr
      then
         par_desc = pt_desc1.
   end. /* ELSE DO */

    /* GET THE COMPONENT UM AND DESCRIPTION */
   {pxrun.i &PROC = 'get_um_desc_data'
                    &PROGRAM = 'pspl.p'
                    &HANDLE  = ph_pspl
                    &PARAM   = "(
                               input  ecd1_comp,
                               output l-um,
                               output comp_desc
                               )"
   }

   display
      ecd1_par @ ecd1par
      par_desc
      ecd1_comp @ ecd1comp
      comp_desc
      ecd1_ref  @ ecd1ref
      ecd1__qad01 @ ecd1qad01
      ecd1_qty_per_b
      l-um @ pt_um
      ecd1_scrp_pct
      ecd1_qty_type
      ecd1_batch_pct
      ecd1_op
      ecd1_item_no
      ecd1__qad03
      false1 when (ecd1__qad04 = "0") @ psmand
      true1  when (ecd1__qad04 <> "0") @ psmand
      false1 when (ecd1__qad05 = "0") @ psdflt
      true1  when (ecd1__qad05 <> "0") @ psdflt
      ecd1_rmks
      true1  when (ecd1_cmtindx <> 0) @ ecdcmmts
      false1 when (ecd1_cmtindx = 0) @ ecdcmmts
      ecd1_lt_off
      ecd1_fcst_pct
      ecd1_group
      ecd1_psprocess
   with frame form06 STREAM-IO /*GUI*/ .

   down.

   if ecd1_cmtindx <> 0
   then do:
      for each cmt_det no-lock
         where cmt_indx = ecd1_cmtindx
      with frame ecdc attr-space side-labels width 80 row 10  overlay:
         FORM /*GUI*/  cmt_seq skip
            cmt_cmmt[1] no-label
            cmt_cmmt[2] no-label
            cmt_cmmt[3] no-label
            cmt_cmmt[4] no-label
            cmt_cmmt[5] no-label
            cmt_cmmt[6] no-label
            cmt_cmmt[7] no-label
            cmt_cmmt[8] no-label
         with STREAM-IO /*GUI*/  frame ecdc width 80.

         /* SET EXTERNAL LABELS */
         setFrameLabels(frame ecdc:handle).
         display cmt_seq + 1 @ cmt_seq
            cmt_cmmt[1 for 8] no-label with frame ecdc STREAM-IO /*GUI*/ .
         down.

         if cmt_cmmt[9] + cmt_cmmt[10] + cmt_cmmt[11] + cmt_cmmt[12]
            + cmt_cmmt[13] + cmt_cmmt[14] + cmt_cmmt[15] <> ""
         then do with frame ecdc:
            display cmt_seq + 1 @ cmt_seq
               cmt_cmmt[9]  @ cmt_cmmt[1]
               cmt_cmmt[10] @ cmt_cmmt[2]
               cmt_cmmt[11] @ cmt_cmmt[3]
               cmt_cmmt[12] @ cmt_cmmt[4]
               cmt_cmmt[13] @ cmt_cmmt[5]
               cmt_cmmt[14] @ cmt_cmmt[6]
               cmt_cmmt[15] @ cmt_cmmt[7]
            with frame ecdc STREAM-IO /*GUI*/ .
            down.
         end. /* IF cmt_cmmt[9]... */

         
/*GUI*/ {mfguichk.i  &warn=false} /*Replace mfrpchk*/

      end. /* FOR EACH cmt_det */

      hide frame ecdc.

   end. /* IF ECD1_CMTINDX <> 0 */

   
/*GUI*/ {mfguichk.i  &warn=false} /*Replace mfrpchk*/


end. /* FOR EACH ecd1_det */

hide frame form06.
